<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); 
  class Update extends CI_Controller {

    function __construct()
    {
       parent::__construct();
         $this->load->library('Auth');
         $this->load->helper('access_helper'); 
         
         $this->load->library('View');
          $this->view->setlayout('themplates/astyle/layout');
         $this->view->setTheme('themplates/astyle');
         
         $this->load->model('render_model', 'render');  
         
    }
    
    function index()
    {
 
     //Доступно как $title в основном шаблоне
        $this->view->setTitle('Update page');
        $this->render->prepare_view(); 
        
        //$this->load->model('update_model', 'update');
        //$this->update->world();
        
        $this->view->render('update');
            
    }
    
    function update_players()
    {
        if (!$this->input->post('update') || !$this->auth->isAuthorised()) 
        {
            redirect(''); return false;       
        }
        
        $this->view->setTitle('Update page');    
        $this->load->model('update_model', 'update');
        $this->update->update_players();    
        
        $this->render->prepare_view();  
        $this->view->render('update_players');
    }
    
}
?>